<!DOCTYPE html>
<html>
	<head>
		<title>Title</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
		<script src="js/ajax.js"></script>
		<script>
		var labelID = "timeLabel";
		var labelElement = null;
		function findElement() {
			labelElement = document.getElementById(labelID);
		};
		
		function startTicking() {
			setInterval(function(){timerFunction();}, 1000);
		};

		function timerFunction() {
			var timeObject = ajaxCall("/rest/time");
			labelElement.innerHTML  = timeObject.time;
			console.log(timeObject);
		}
		</script>
		<link rel="stylesheet" type="text/css" href="css/main.css">
	</head>
	<body onload="findElement();startTicking();">
		<label id="timeLabel"></label>
	</body>
</html>
